﻿//********************************************************************
// Author:      刘艳明
// Create Date: 2012-09-30
// Description: 
//
// Version:     1.0.0.0
// Change History:
// Date		    Who		      Changes Maded
//--------------------------------------------------------------------
// Please Insert the Modiy record here!
//--------------------------------------------------------------------
//********************************************************************



using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Xml.Serialization;
using MillerApp.DataContract.Common;
using MillerApp.DataContract.Common.Entity;

namespace MillerApp.DataContract.MillerDB
{
    #region SecurityEntity
    /// <summary>
    /// 这个实体提供了 SecurityEntity ()的属性和方法.
    /// </summary>
    [DataContract]
    public partial class SecurityEntity : BaseEntity<SecurityEntity>, IEquatable<SecurityEntity>
    {

        #region Properties
        private DateTime? _listeddate;
        /// <summary>
        /// 获取或设置listeddate date AllowDBNull
        /// </summary>
        [DataMember]
        public DateTime? listeddate
        {
            get { return _listeddate; }
            set
            {
                _listeddate = value;
                //NotifyPropertyChange("listeddate");
            }
        }

        private string _pysx = String.Empty;
        /// <summary>
        /// 获取或设置pysx character varying(10) AllowDBNull
        /// </summary>
        [DataMember]
        public string pysx
        {
            get { return _pysx; }
            set
            {
                _pysx = value;
                //NotifyPropertyChange("pysx");
            }
        }

        private int? _status;
        /// <summary>
        /// 获取或设置status integer AllowDBNull
        /// </summary>
        [DataMember]
        public int? status
        {
            get { return _status; }
            set
            {
                _status = value;
                //NotifyPropertyChange("status");
            }
        }

        private int _id;
        /// <summary>
        /// 获取或设置id integer NotAllowDBNull
        /// </summary>
        [DataMember]
        public int id
        {
            get { return _id; }
            set
            {
                _id = value;
                //NotifyPropertyChange("id");
            }
        }

        private string _stockexchangecode = String.Empty;
        /// <summary>
        /// 获取或设置stockexchangecode character varying(5) AllowDBNull
        /// </summary>
        [DataMember]
        public string stockexchangecode
        {
            get { return _stockexchangecode; }
            set
            {
                _stockexchangecode = value;
                //NotifyPropertyChange("stockexchangecode");
            }
        }

        private string _compcode = String.Empty;
        /// <summary>
        /// 获取或设置compcode character(6) AllowDBNull
        /// </summary>
        [DataMember]
        public string compcode
        {
            get { return _compcode; }
            set
            {
                _compcode = value;
                //NotifyPropertyChange("compcode");
            }
        }

        private string _secshortname = String.Empty;
        /// <summary>
        /// 获取或设置secshortname character varying(10) AllowDBNull
        /// </summary>
        [DataMember]
        public string secshortname
        {
            get { return _secshortname; }
            set
            {
                _secshortname = value;
                //NotifyPropertyChange("secshortname");
            }
        }

        private string _seccode = String.Empty;
        /// <summary>
        /// 获取或设置seccode character(6) NotAllowDBNull
        /// </summary>
        [DataMember]
        public string seccode
        {
            get { return _seccode; }
            set
            {
                _seccode = value;
                //NotifyPropertyChange("seccode");
            }
        }


        #endregion

        /// <summary>
        /// 构造函数
        /// </summary>
        public SecurityEntity()
        {
        }

        #region IEquatable<SecurityEntity> 成员
        /// <summary>
        /// 比较两个实例数据库表中的字段是否相等
        /// </summary>
        /// <param name="other">SecurityEntity</param>
        /// <returns>bool</returns>
        public bool Equals(SecurityEntity other)
        {
            return this.listeddate.Equals(other.listeddate) && this.pysx.Equals(other.pysx) && this.status.Equals(other.status) && this.id.Equals(other.id) && this.stockexchangecode.Equals(other.stockexchangecode) && this.compcode.Equals(other.compcode) && this.secshortname.Equals(other.secshortname) && this.seccode.Equals(other.seccode);
        }

        #endregion

        #region IDataKey 成员


        #endregion
    }

    public partial class SecurityEntity
    {
        #region
        public string statusString
        {
            get
            {
                switch (this._status)
                {
                    case 0: return "未上市";
                    case 1: return "已上市";
                    case 2: return "已退市";
                    default: return "已上市";
                }
            }
        }
        public string exchangeName
        {
            get
            {
                if (this._stockexchangecode.Trim().ToLower() == "sz")
                {
                    return "深圳证券交易所";
                }
                if (this._stockexchangecode.Trim().ToLower() == "sh")
                {
                    return "上海证券交易所";
                }
                return string.Empty;
            }
        }
        #endregion
    }
    #endregion
}

